using System.Collections.Specialized;
using System.ComponentModel;
using EnvDTE;
using Microsoft.Practices.RecipeFramework.Library.Converters;
using Microsoft.Practices.RecipeFramework.Library.Editors;
using Microsoft.Practices.WizardFramework;
using VSSDKAssist.Assets.Converters;
using VSSDKAssist.Recipes.Common.CustomPages;
using VSSDKAssist.Recipes.Common.Helpers;

namespace VSSDKAssist.Recipes.CreateVSCustomTool
{
	/// <summary>
    /// Custom page for CreateVSCustomTool recipe
	/// </summary>
	public partial class CreateVSCustomToolCP2 : WizardPageBase
	{
		/// <summary>
        /// Initializes a new instance of the <see cref="CreateVSCustomToolCP2"/> class.
		/// </summary>
		public CreateVSCustomToolCP2()
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="CreateVSCustomToolCP2"/> class.
		/// </summary>
		/// <param name="wizard">The <see cref="T:Microsoft.Practices.WizardFramework.WizardForm"/>that will host the new page.</param>
        public CreateVSCustomToolCP2(WizardForm wizard)
			: base(wizard)
		{
			InitializeComponent();
		}

        [RecipeArgument]
        public bool GeneratesDesignTimeSource
        {
            get { return chkGeneratesDesignTimeSource.Checked; }
            set
            {
                chkGeneratesDesignTimeSource.Checked = value;
            }
        }

        [RecipeArgument]
        public bool GeneratesSharedDesignTimeSource
        {
            get { return chkGeneratesSharedDesignTimeSource.Checked; }
            set
            {
                chkGeneratesSharedDesignTimeSource.Checked = value;
            }
        }

        [RecipeArgument]
        public bool VCSProjectContext
        {
            get { return chkVCSProjectSupport.Checked; }
            set
            {
                chkVCSProjectSupport.Checked = value;
            }
        }

        [RecipeArgument]
        public bool VBProjectContext
        {
            get { return chkVBProjectSupport.Checked; }
            set
            {
                chkVBProjectSupport.Checked = value;
            }
        }

        [RecipeArgument]
        public bool VJSProjectContext
        {
            get { return chkVJSProjectSupport.Checked; }
            set
            {
                chkVJSProjectSupport.Checked = value;
            }
        }

        private void chkGeneratesDesignTimeSource_CheckedChanged(object sender, System.EventArgs e)
        {
            DictionaryService.SetValue("GeneratesDesignTimeSource", chkGeneratesDesignTimeSource.Checked);
        }

        private void chkGeneratesSharedDesignTimeSource_CheckedChanged(object sender, System.EventArgs e)
        {
            DictionaryService.SetValue("GeneratesSharedDesignTimeSource", chkGeneratesSharedDesignTimeSource.Checked);
        }

        private void chkVCSProjectSupport_CheckedChanged(object sender, System.EventArgs e)
        {
            DictionaryService.SetValue("VCSProjectContext", chkVCSProjectSupport.Checked);
        }

        private void chkVBProjectSupport_CheckedChanged(object sender, System.EventArgs e)
        {
            DictionaryService.SetValue("VBProjectContext", chkVBProjectSupport.Checked);
        }

        private void chkVJSProjectSupport_CheckedChanged(object sender, System.EventArgs e)
        {
            DictionaryService.SetValue("VJSProjectContext", chkVJSProjectSupport.Checked);
        }
    }
}